#include "..\Socks5Server\SockClient.h"
#include <stdio.h>

void main()
{
	try {
		SockClient s("www.google.com", 80);

		//char *sir = "GET http://www.google.com HTTP/1.0\n\r\n\r\n\r";

		//char *sir = "POST / HTTP/1.0\r\nAccept: */*\r\nUser-Agent: Mozilla/4.0\r\nAccept-Language: en-us\r\nAccept-Encoding: gzip, deflate\r\nHost: http://www.google.ro\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n\r\n\r\n";

		//If you need to send a basic authorization
		//string Auth        = "username:password";
		//Figureout a way to encode test into base64 !
		//string AuthInfo    = base64_encode(reinterpret_cast<const unsigned char*>(Auth.c_str()),Auth.length());
		//string sPassReq    = "Authorization: Basic " + AuthInfo;
		//SEND_RQ(sPassReq.c_str());


		char *sir = "GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1\n\r\n\r\n\r";
		s.SendBytes((LPBYTE)sir,strlen(sir));
		
		ULONG max_ = 4096;
		char rcvBuff[4096];

		s.ReadBytes((LPBYTE)rcvBuff,max_);
		rcvBuff[max_] = '\0';
		printf("%s",rcvBuff);

	} 
	catch (...) {
		
	}

}